import os
import shutil
import json

APP_ROOT = os.path.dirname(__file__)

config_file_path = '.file-sync.json'

class __FakeObject:
    pass

APP_USER_CONFIG = None

def load_config(file_path=''):
    if len(file_path) == 0:
        if not os.path.exists(config_file_path):
            shutil.copy(APP_ROOT + '/../config/config.json', config_file_path)
        file_path = config_file_path
    with open(str(file_path)) as fd:
        return json.load(fd)
    return __FakeObject()

class ProductionConfig():
    SQLALCHEMY_TRACK_MODIFICATIONS = True
    SECRET_KEY = 'D&WEFSDfsf238493-F+234fASFSASD'

APP_CONFIG = ProductionConfig()

